import { Service } from "cl-admin";
import BaseService from "@/service/base";
@Service("ratioreport")
class PreSale extends BaseService {
	getParams({ dateArr, ...args }) {
		return { ...args, year: dateArr?.[0] || '', month: dateArr?.[1] || '' }
	}
	// 门店占比报表
	shop(query) {
		let params = this.getParams(query)
		return this.$get("/shop", { params });
	}
	// 上传门店占比报表
	shopFile(query) {
		let params = this.getParams(query)
		return this.$post("/shopFile", { params });
	}
	// 部门占比报表
	dept(query) {
		let params = this.getParams(query)
		return this.$get("/dept", { params });
	}
	// 上传部门占比报表
	deptFile(query) {
		let params = this.getParams(query)
		return this.$post("/deptFile", { params });
	}
	// 清除缓存
	clearCache(query) {
		let params = this.getParams(query)
		return this.$get('/clearCache', { params })
	}
}

export default PreSale;
